<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户列表</title>
	<style>
		a{
			text-decoration: none;
		}
		li{
			list-style: none;
		}
		table
		{
			border-collapse: collapse;
			text-align: center;
			table-layout: fixed;
		}
		table td, table th
		{
			border: 1px solid #cad9ea;
			color: #666;
		}
		table thead th
		{
			background-color: #CCE8EB;

		}
		table tr:nth-child(odd)
		{
			background: #fff;
		}
		table tr:nth-child(even)
		{
			background: #F5FAFA;
		}
	</style>
</head>
<body>
	<ul>
		<li><a href="admin.jsp">返回管理员首页</a></li>
		<li style="float: left;margin-right: 20px"><a href="AdminPageSelectUserServlet">用户列表</a></li>
		<li style="float: left"><a href="admin_useradd.jsp">用户增加</a></li>
	</ul>
	<h1 align="center">用户列表</h1>
	<table border="2" align="center">
		<tr>
			<td>id</td>
			<td>名称</td>
			<td>密码</td>
			<td>邮箱</td>
			<td>地址</td>
			<td>头像</td>
			<td>操作</td>
		</tr>
		<c:forEach items="${page.list}" var="user">
			<tr>
				<td>${user.id}</td>
				<td>${user.username}</td>
				<td>${user.password}</td>
				<td>${user.email}</td>
				<td>${user.address}</td>
				<td>${user.img}</td>
				<td><a href="AdminDeleteUserServlet?id=${user.id}">删除</a>|<a href="AdminGetUserMessageServlet?id=${user.id}">修改</a></td>
			</tr>
		</c:forEach>
	</table>

		<table align="center" style="margin-top: 10px">
		<c:choose>
			<c:when test="${page.pageNum == 1 }">
			</c:when>
			<c:otherwise>
				<tr><td><a href="AdminPageSelectUserServlet?currentPage=1">首页</a></td>
			<td><a href="AdminPageSelectUserServlet?currentPage=${page.prePageNum }">上一页</a></td>
			</c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${page.pageNum == page.totalPageNum }">
			</c:when>
			<c:otherwise>
			<td><a href="AdminPageSelectUserServlet?currentPage=${page.nextPageNum }">下一页</a></td>
				<td><a href="AdminPageSelectUserServlet?currentPage=${page.totalPageNum }">尾页</a></td>
			</c:otherwise>
		</c:choose>
			<td><a href="#" style="color: red;">一共有${page.totalCount}条数据,当前是第${page.pageNum }页</a></td>
			</tr>
		</table>

</body>
</html>